package consts

import "github.com/gogf/gf/v2/frame/g"

const (
	StatusCustomStartPlaceholder = 400000
	StatusCustomGoneData         = 400410
	StatusCustomNotApproved      = 400100
	StatusUndefinedFunc          = 500100
	StatusCustomEndPlaceholder   = 600000
)

var statusCustomText = map[int]string{
	StatusCustomGoneData:    "数据匹配失败",
	StatusCustomNotApproved: "参数校验失败",
	StatusUndefinedFunc:     "未定义的方法",
}

type cStatusCustom struct {
}

var (
	insStatusCustom = cStatusCustom{}
)

func StatusCustom() *cStatusCustom {
	return &insStatusCustom
}

func (c *cStatusCustom) Text(code int) string {
	str, ok := statusCustomText[code]
	if !ok {
		return ""
	}
	return str
}

func (c *cStatusCustom) Enum() g.MapIntStr {
	return statusCustomText
}
